<template>
  <Card :option="option" />
</template>

<script setup>
import { defineAsyncComponent, reactive,watch,ref } from 'vue'

// 引入组件
const Card = defineAsyncComponent(() => import('./card.vue'))
const props = defineProps({
  Data: {
    type: Object,
    default: '',
  }
})
const option = ref({})
const Data = ref({});
watch(() => props.Data, () => {
  Data.value = props.Data;
  option.value = {
  title: '订单统计',
  total:  Data.value.TolOrderNum,
  totalName: '总订单',
  tips: '含初始化、审核中、审核拒绝、待支付、待发货、待收货、租赁中、逾期、已完结、已买断、已取消、归还中、已归还',
  children: [
    {
      label: '初始化',
      data: Data.value.InitializeNum,
      tips: '当前处于初始化状态的订单总和',
    },
    {
      label: '审核中',
      data: Data.value.InReviewNum,
      tips: '当前处于审核中的订单数量总和',
    },
    {
      label: '审核拒绝',
      data: Data.value.ReviewRejectNum,
      tips: '所有审核拒绝的订单总和',
    },
    {
      label: '已取消',
      data: Data.value.CanceledNum,
      tips: '所有已取消的订单数量总和',
    },
  ],
}
})
</script>
